package com.cc.demo.component;

import cn.hutool.core.thread.ThreadUtil;
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.client.job.core.executor.AbstractJobExecutor;
import com.aizuda.snailjob.client.model.ExecuteResult;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
public class TestDiscardJob extends AbstractJobExecutor {
    @Override
    protected ExecuteResult doJobExecute(JobArgs jobArgs) {
        // 休眠5分钟
        ThreadUtil.sleep(5, TimeUnit.MINUTES);
        return ExecuteResult.success();
    }
}
